package com.gxa.modules.pc.hospital.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.modules.model.entity.hospital.Health;
import com.gxa.modules.pc.hospital.mapper.HealthMapper;
import com.gxa.modules.pc.hospital.service.HealthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.UUID;

/**
 * <p>
 * 健康百科文章表 服务实现类
 * </p>
 *
 * @author gxa
 * @since 2022-11-12 05:04:59
 */
@Service
public class HealthServiceImpl extends ServiceImpl<HealthMapper, Health> implements HealthService {

    @Autowired
    private HealthMapper healthMapper;

    /**
     * 批量删除
     * @param ids
     */
    @Override
    public String delByIds(List<Long> ids) {

        QueryWrapper<Health> wrapper = new QueryWrapper<>();
        wrapper.in("id",ids);
        healthMapper.delete(wrapper);

        return "删除成功";

    }

    /**
     * 增加健康百科
     * @param health
     */
    @Override
    public void add(Health health) {
        healthMapper.insert(health);
    }

    @Override
    public void update(Health health) {
        healthMapper.updateById(health);
    }

    @Override
    public Health queryById(Integer id) {
        return healthMapper.selectById(id);
    }


}
